import Mock from 'mockjs'

const {mock} = Mock; // Mock函数

// 使用拦截规则拦截命中的请求
// mock( url, post/get, 返回的数据/函数（有return值）);
mock("/api/depts", "get", {
    code: 200,
    data: {
        total: 11,
        list: Array.from({length: 11}, () => ({
            id: Mock.Random.id(),
            deptName: Mock.Random.string(),
            leader: Mock.Random.name(),
            phone: Mock.Random.integer(),
            email: Mock.Random.email(),
            status: Mock.Random.pick(['1', '0']),
            createdTime: Mock.Random.date(),
            createdBy: Mock.Random.name(),
            updatedTime: Mock.Random.date(),
            updatedBy: Mock.Random.cname(),
        }))
    }
    }
);
